package com.anjie.powerproject.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebSecurityConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry){
/*      registry.addInterceptor(new LoginInterceptor()).excludePathPatterns("/login.html","/title/get/**","/test/**",
                "/", "/manager/login","/manager/checkManager","/graphInfo/viewGraphInfo","/css/**","/font/**","/img/**","/img2/**","/js/**","/layer/**","/resources/**",
                "/view.html","/view.html/**","/viewChart.html/**","/strategy/predict_data/**","/relationship/getViewAtlas","/gen","/device/**",
                "/strategyJL/getDayWeather","/strategyJL/predict_data/**","/strategyJL/getViewAtlas","/strategyJL/getHighlightPic/**","/strategy/gen/**","/strategyJL/viewLastestMultiMode").addPathPatterns("/**");*/

        // 测试时打开该注释，注释掉上面的registry，取消所有拦截器
        registry.addInterceptor(new NoInterceptor()).excludePathPatterns("/**").addPathPatterns("/**");
        WebMvcConfigurer.super.addInterceptors(registry);
    }

}
